3.3.53 \(\int \frac {(e+f x) \cos (c+d x)}{a+a \sin (c+d x)} \, dx\) [253]

Optimal. Leaf size=79 \[ -\frac {i (e+f x)^2}{2 a f}+\frac {2 (e+f x) \log \left (1-i e^{i (c+d x)}\right )}{a d}-\frac {2 i f \text {Li}_2\left (i e^{i (c+d x)}\right )}{a d^2} \]

[Out]

-1/2*I*(f*x+e)^2/a/f+2*(f*x+e)*ln(1-I*exp(I*(d*x+c)))/a/d-2*I*f*polylog(2,I*exp(I*(d*x+c)))/a/d^2

________________________________________________________________________________________

Rubi [A]
time = 0.08, antiderivative size = 79, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {4613, 2221, 2317, 2438} \begin {gather*} -\frac {2 i f \text {PolyLog}\left (2,i e^{i (c+d x)}\right )}{a d^2}+\frac {2 (e+f x) \log \left (1-i e^{i (c+d x)}\right )}{a d}-\frac {i (e+f x)^2}{2 a f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((e + f*x)*Cos[c + d*x])/(a + a*Sin[c + d*x]),x]

[Out]

((-1/2*I)*(e + f*x)^2)/(a*f) + (2*(e + f*x)*Log[1 - I*E^(I*(c + d*x))])/(a*d) - ((2*I)*f*PolyLog[2, I*E^(I*(c
+ d*x))])/(a*d^2)

Rule 2221

Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/((a_) + (b_.)*((F_)^((g_.)*((e_.) +
 (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp[((c + d*x)^m/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x]
 - Dist[d*(m/(b*f*g*n*Log[F])), Int[(c + d*x)^(m - 1)*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x], x] /; FreeQ[{F,
a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]

Rule 2317

Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Dist[1/(d*e*n*Log[F]), Subst[Int
[Log[a + b*x]/x, x], x, (F^(e*(c + d*x)))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]

Rule 2438

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2, (-c)*e*x^n]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 4613

Int[(Cos[(c_.) + (d_.)*(x_)]*((e_.) + (f_.)*(x_))^(m_.))/((a_) + (b_.)*Sin[(c_.) + (d_.)*(x_)]), x_Symbol] :>
Simp[(-I)*((e + f*x)^(m + 1)/(b*f*(m + 1))), x] + Dist[2, Int[(e + f*x)^m*(E^(I*(c + d*x))/(a - I*b*E^(I*(c +
d*x)))), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IGtQ[m, 0] && EqQ[a^2 - b^2, 0]

Rubi steps

\begin {align*} \int \frac {(e+f x) \cos (c+d x)}{a+a \sin (c+d x)} \, dx &=-\frac {i (e+f x)^2}{2 a f}+2 \int \frac {e^{i (c+d x)} (e+f x)}{a-i a e^{i (c+d x)}} \, dx\\ &=-\frac {i (e+f x)^2}{2 a f}+\frac {2 (e+f x) \log \left (1-i e^{i (c+d x)}\right )}{a d}-\frac {(2 f) \int \log \left (1-i e^{i (c+d x)}\right ) \, dx}{a d}\\ &=-\frac {i (e+f x)^2}{2 a f}+\frac {2 (e+f x) \log \left (1-i e^{i (c+d x)}\right )}{a d}+\frac {(2 i f) \text {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{i (c+d x)}\right )}{a d^2}\\ &=-\frac {i (e+f x)^2}{2 a f}+\frac {2 (e+f x) \log \left (1-i e^{i (c+d x)}\right )}{a d}-\frac {2 i f \text {Li}_2\left (i e^{i (c+d x)}\right )}{a d^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(246\) vs. \(2(79)=158\).
time = 0.29, size = 246, normalized size = 3.11 \begin {gather*} \frac {-i c^2 f+i c f \pi -2 i c d f x+i d f \pi x-i d^2 f x^2+4 f \pi \log \left (1+e^{-i (c+d x)}\right )+4 c f \log \left (1-i e^{i (c+d x)}\right )+2 f \pi \log \left (1-i e^{i (c+d x)}\right )+4 d f x \log \left (1-i e^{i (c+d x)}\right )-4 f \pi \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+4 d e \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )-4 c f \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )-2 f \pi \log \left (\sin \left (\frac {1}{4} (2 c+\pi +2 d x)\right )\right )-4 i f \text {Li}_2\left (i e^{i (c+d x)}\right )}{2 a d^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((e + f*x)*Cos[c + d*x])/(a + a*Sin[c + d*x]),x]

[Out]

((-I)*c^2*f + I*c*f*Pi - (2*I)*c*d*f*x + I*d*f*Pi*x - I*d^2*f*x^2 + 4*f*Pi*Log[1 + E^((-I)*(c + d*x))] + 4*c*f
*Log[1 - I*E^(I*(c + d*x))] + 2*f*Pi*Log[1 - I*E^(I*(c + d*x))] + 4*d*f*x*Log[1 - I*E^(I*(c + d*x))] - 4*f*Pi*
Log[Cos[(c + d*x)/2]] + 4*d*e*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]] - 4*c*f*Log[Cos[(c + d*x)/2] + Sin[(c +
 d*x)/2]] - 2*f*Pi*Log[Sin[(2*c + Pi + 2*d*x)/4]] - (4*I)*f*PolyLog[2, I*E^(I*(c + d*x))])/(2*a*d^2)

________________________________________________________________________________________

Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 202 vs. \(2 (69 ) = 138\).
time = 0.15, size = 203, normalized size = 2.57

method result size
risch \(-\frac {i f \,x^{2}}{2 a}+\frac {i e x}{a}+\frac {2 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) e}{d a}-\frac {2 \ln \left ({\mathrm e}^{i \left (d x +c \right )}\right ) e}{d a}-\frac {2 i f c x}{d a}-\frac {i f \,c^{2}}{d^{2} a}+\frac {2 f \ln \left (1-i {\mathrm e}^{i \left (d x +c \right )}\right ) x}{d a}+\frac {2 f \ln \left (1-i {\mathrm e}^{i \left (d x +c \right )}\right ) c}{d^{2} a}-\frac {2 i f \polylog \left (2, i {\mathrm e}^{i \left (d x +c \right )}\right )}{a \,d^{2}}-\frac {2 f c \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d^{2} a}+\frac {2 f c \ln \left ({\mathrm e}^{i \left (d x +c \right )}\right )}{d^{2} a}\) \(203\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((f*x+e)*cos(d*x+c)/(a+a*sin(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

-1/2*I/a*f*x^2+I/a*e*x+2/d/a*ln(exp(I*(d*x+c))+I)*e-2/d/a*ln(exp(I*(d*x+c)))*e-2*I/d/a*f*c*x-I/d^2/a*f*c^2+2/d
/a*f*ln(1-I*exp(I*(d*x+c)))*x+2/d^2/a*f*ln(1-I*exp(I*(d*x+c)))*c-2*I*f*polylog(2,I*exp(I*(d*x+c)))/a/d^2-2/d^2
/a*f*c*ln(exp(I*(d*x+c))+I)+2/d^2/a*f*c*ln(exp(I*(d*x+c)))

________________________________________________________________________________________

Maxima [A]
time = 0.34, size = 116, normalized size = 1.47 \begin {gather*} \frac {-i \, d^{2} f x^{2} - 2 i \, d^{2} e x - 4 i \, d f x \arctan \left (\cos \left (d x + c\right ), \sin \left (d x + c\right ) + 1\right ) + 4 i \, d e \arctan \left (\sin \left (d x + c\right ) + 1, \cos \left (d x + c\right )\right ) - 4 i \, f {\rm Li}_2\left (i \, e^{\left (i \, d x + i \, c\right )}\right ) + 2 \, {\left (d f x + d e\right )} \log \left (\cos \left (d x + c\right )^{2} + \sin \left (d x + c\right )^{2} + 2 \, \sin \left (d x + c\right ) + 1\right )}{2 \, a d^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x+e)*cos(d*x+c)/(a+a*sin(d*x+c)),x, algorithm="maxima")

[Out]

1/2*(-I*d^2*f*x^2 - 2*I*d^2*e*x - 4*I*d*f*x*arctan2(cos(d*x + c), sin(d*x + c) + 1) + 4*I*d*e*arctan2(sin(d*x
+ c) + 1, cos(d*x + c)) - 4*I*f*dilog(I*e^(I*d*x + I*c)) + 2*(d*f*x + d*e)*log(cos(d*x + c)^2 + sin(d*x + c)^2
 + 2*sin(d*x + c) + 1))/(a*d^2)

________________________________________________________________________________________

Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 160 vs. \(2 (66) = 132\).
time = 0.36, size = 160, normalized size = 2.03 \begin {gather*} \frac {-i \, f {\rm Li}_2\left (i \, \cos \left (d x + c\right ) - \sin \left (d x + c\right )\right ) + i \, f {\rm Li}_2\left (-i \, \cos \left (d x + c\right ) - \sin \left (d x + c\right )\right ) - {\left (c f - d e\right )} \log \left (\cos \left (d x + c\right ) + i \, \sin \left (d x + c\right ) + i\right ) + {\left (d f x + c f\right )} \log \left (i \, \cos \left (d x + c\right ) + \sin \left (d x + c\right ) + 1\right ) + {\left (d f x + c f\right )} \log \left (-i \, \cos \left (d x + c\right ) + \sin \left (d x + c\right ) + 1\right ) - {\left (c f - d e\right )} \log \left (-\cos \left (d x + c\right ) + i \, \sin \left (d x + c\right ) + i\right )}{a d^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x+e)*cos(d*x+c)/(a+a*sin(d*x+c)),x, algorithm="fricas")

[Out]

(-I*f*dilog(I*cos(d*x + c) - sin(d*x + c)) + I*f*dilog(-I*cos(d*x + c) - sin(d*x + c)) - (c*f - d*e)*log(cos(d
*x + c) + I*sin(d*x + c) + I) + (d*f*x + c*f)*log(I*cos(d*x + c) + sin(d*x + c) + 1) + (d*f*x + c*f)*log(-I*co
s(d*x + c) + sin(d*x + c) + 1) - (c*f - d*e)*log(-cos(d*x + c) + I*sin(d*x + c) + I))/(a*d^2)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {e \cos {\left (c + d x \right )}}{\sin {\left (c + d x \right )} + 1}\, dx + \int \frac {f x \cos {\left (c + d x \right )}}{\sin {\left (c + d x \right )} + 1}\, dx}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x+e)*cos(d*x+c)/(a+a*sin(d*x+c)),x)

[Out]

(Integral(e*cos(c + d*x)/(sin(c + d*x) + 1), x) + Integral(f*x*cos(c + d*x)/(sin(c + d*x) + 1), x))/a

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x+e)*cos(d*x+c)/(a+a*sin(d*x+c)),x, algorithm="giac")

[Out]

integrate((f*x + e)*cos(d*x + c)/(a*sin(d*x + c) + a), x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {\cos \left (c+d\,x\right )\,\left (e+f\,x\right )}{a+a\,\sin \left (c+d\,x\right )} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((cos(c + d*x)*(e + f*x))/(a + a*sin(c + d*x)),x)

[Out]

int((cos(c + d*x)*(e + f*x))/(a + a*sin(c + d*x)), x)

________________________________________________________________________________________